<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function Person(){
        this.name = 'frank';
        this.age = 30;
        this.say = function(){
            alert(this.name)
        }
    }

    var user = new Person();    //user.age,user.name
    //在外部修改
    user.say();//frank
    user.name = 'tom';
    user.age = 20;
    user.say(); //tom

//    var u = Person();//this.age === window.age  this.name == window.name
</script>
</body>
</html>